package cn.wolfcode.luowowo.acticle.mapper;

import cn.wolfcode.luowowo.acticle.domain.StrategyTag;
import cn.wolfcode.luowowo.common.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StrategyTagMapper {
    int deleteByPrimaryKey(Long id);

    int insert(StrategyTag record);

    StrategyTag selectByPrimaryKey(Long id);

    List<StrategyTag> selectAll();

    int updateByPrimaryKey(StrategyTag record);

    List<StrategyTag> selectForList(QueryObject qo);

    /**
     * 删除标签与明细间关系
     * @param detailId
     */
    void deleteRelation(Long detailId);

    /**
     * 维护标签与明细见关系
     * @param tagId
     * @param detailId
     */
    void insertRelation(@Param("tagId") Long tagId, @Param("detailId") Long detailId);

    /**
     * 查询标签
     * @param tag
     * @return
     */
    List<StrategyTag> selectTagByName(String tag);

    List<String> selectTagsByDetailId(Long id);
}